package thread;

public class work {
    public static int divisorSubstrings(int num, int k) {
        String num1 = String.valueOf(num);
        int x = num1.length();
        int y = 0;
        for(int i = 0;i<=x-k;i++){
            String num2 = num1.substring(i,i+k);
            int num3 = Integer.parseInt(num2);
            if(num3 != 0 && (num%num3) == 0){
                y++;
            }
        }
        return y;
    }

    public static void main(String[] args) {
        int i = divisorSubstrings(240,2);
        System.out.println(i);
    }
}
